# import re
#
# import pymysql
# from fontTools.ttLib import TTFont
#
# font = TTFont("./trans.woff")
# num_list_eng = font.getGlyphOrder()[1:]
#
# num_dict = {
#     "zero": 0, "one": 1, "two": 2, "three": 3, "four": 4,
#     "five": 5, "six": 6, "seven": 7, "eight": 8, "nine": 9
# }
# num_list_alb = [num_dict[i] for i in num_list_eng]
#
# print(num_list_alb)
#
# strs = '英菲尼迪-英菲尼迪Q80L 1026款 1.0T 悦享版'
# new_str = ''
#
# for i in strs:
#     if i.isdigit():
#         real_alb = num_list_alb.index(int(i))
#         new_str += str(real_alb)
#         print(real_alb, type(real_alb))
#     else:
#         new_str += i
# print(new_str)

#
# strs = """
#             @font-face {
#                 font-family: "rrc-font-defender";
#                 src: url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.eot');
#                 src:
#                     url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.eot?#iefix') format('embedded-opentype'),
#                     url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.woff') format('woff'),
#                     url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.ttf') format('truetype'),
#                     url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.svg') format('svg');
#                     font-weight: normal;
#                     font-style: normal;
#                 }
#
#             .rrcttffa96d5ab0310221a774472ea3c4b9f95 {
#                 font-family: "rrc-font-defender"!important;
#             }
#         """
#
# print(re.match(r"[\s\S]*?url\(\'(.*\.woff)", strs).group(1))
#
#
# import re
#
# # CSS代码
# css_code = """
# @font-face {
#     font-family: "rrc-font-defender";
#     src: url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.eot');
#     src:
#         url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.eot?#iefix') format('embedded-opentype'),
#         url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.woff') format('woff'),
#         url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.ttf') format('truetype'),
#         url('https://misc.rrcimg.com/ttf/rrcttffa96d5ab0310221a774472ea3c4b9f95.svg') format('svg');
#         font-weight: normal;
#         font-style: normal;
#     }
#
# .rrcttffa96d5ab0310221a774472ea3c4b9f95 {
#     font-family: "rrc-font-defender"!important;
# }
# """
#
# # 使用正则表达式提取woff文件的URL
# woff_url_match = re.search(r"url\('([^']+)'\) format\('woff'\)", css_code)
# if woff_url_match:
#     woff_url = woff_url_match.group(1)
#     print("WOFF字体文件的URL:", woff_url)
# else:
#     print("未找到WOFF字体文件的URL。")


